<template>
<div>

</div>
</template>


<script>
export default {
    
    beforeCreate:function(){
        
        $.get('/users/isLogin')
        .then(data=>{
            if(data.err === 4){
                this.$router.push({path: 'login'})
                // location.href = '#/a'
            }
            if(data.err === 0){
                this.$router.push({path: 'daily'})
                // location.href = '#/daily'
            }
            // 隐藏loading
            this.$vux.loading.hide();
        })
        .catch((err)=>{
            console.log(err);
            this.$vux.loading.hide();
            if(err.status===504){
                alert("网络错误");
            }
        })
    },

    created:function(){
        this.$vux.loading.show({
            text: 'Loading'
        })
    }
}
</script>


<style scoped>

</style>